let { Schema, model } = require('mongoose');
require('./subjectModel')
// 规定文档结构
let teachersSchema = new Schema({
    userNumber: String,
    name: String,
    gender: String,
    age: String,
    phone: String,
    passwd: String,
    role:{
        type:String,
        default:"teachers"
    },
    state: {
        type: String,
        required: true,
        default: '待审核'
    },
    unJoin: String,
    classId: {
        type: Schema.Types.ObjectId,
        ref: "classModel"
    },
    subjectId: [{
        type: Schema.Types.ObjectId,
        ref: "subjectModel"
    }]
}, {
    versionKey: false
})

module.exports = model("teachersModel", teachersSchema, "teachers")